package com.small.common.constant;

/**
 * redis相关常量
 * @author dingyou
 * @version 1.0
 * @date 2018/10/15
 */
public class RedisConstants {
    /**
     * 默认缓存过期时间,单位:秒
     */
    public static final int DEFAULT_CACHE_TIMEOUT = 24 * 60 * 60;

    /**
     * 分布式锁的前缀
     */
    public static final String LOCK_PREFIX = "lock:";

    /**
     * redis setNX时返回的ok
     */
    public static final String OK = "OK";
    /**
     * set时的参数设置过期时间,毫秒
     */
    public static final String PX = "PX";

    /**
     * set时的参数设置过期时间,秒
     */
    public static final String EX = "EX";

    /**
     * set时的参数, 只有键key不存在的时候才会设置key的值
     */
    public static final String NX = "NX";

    /**
     * 只有键key存在的时候才会设置key的值
     */
    public static final String XX = "XX";

    /**
     * 用户perm key
     */
    public static final String USER_PERM_KEY_PREFIX = "userItem:";

    /**
     * permFlag key
     */
    public static final String PERM_FLAG_KEY_PREFIX = "permFlag:";

    /**
     * sysConfig key
     */
    public static final String SYS_CONFIG_KEY_PREFIX = "sysConfig:";

    /**
     * token的前缀
     */
    public static final String TOKEN_PREFIX = "token:";

    /**
     * 用户登陆设备信息
     */
    public static final String USER_LOGIN_DEVICE = "userLoginDevice:";

    /**
     * 用户信息的前缀
     */
    public static final String USER_PREFIX = "user:";

    /**
     * 服务器端CRM服务号微信AccessToken的key
     */
    public static final String JDK_ACCESS_TOKEN = "ACCESS_TOKEN:JDK";

    /**
     * 品类的前缀
     */
    public static final String CATE_PREFIX = "cate:";
}
